home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK1.toast / Development Kits (Disc 1) / QuickDraw 3D / Development / Interfaces / QD3DPascalInterfaces / QD3DSet.p < prev    next >
Encoding:
Text File  |  1996-11-15  |  9.5 KB  |  242 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        QD3DSet.p
  3.  
  4.      Contains:    Set types and routines                                            
  5.  
  6.      Version:    Technology:    Quickdraw 3D 1.0.6
  7.                  Release:    Universal Interfaces 2.1.5d1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT QD3DSet;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __QD3DSET__}
  28. {$SETC __QD3DSET__ := 1}
  29.  
  30. {$I+}
  31. {$SETC QD3DSetIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __QD3D__}
  35. {$I QD3D.p}
  36. {$ENDC}
  37.  
  38. {$PUSH}
  39. {$ALIGN POWER}
  40. {$LibExport+}
  41.  
  42. {
  43. *****************************************************************************
  44.  **                                                                             **
  45.  **                                Set Types                                     **
  46.  **                                                                             **
  47.  ****************************************************************************
  48. }
  49.  
  50. TYPE
  51.     TQ3ElementType                        = LONGINT;
  52. {
  53.  *    kQ3ElementTypeUnknown is an TQ3Object. 
  54.  *    
  55.  *        Do Q3Set_Add(s, ..., &obj) or Q3Set_Get(s, ..., &obj);
  56.  *        
  57.  *        Note that the object is always referenced when copying around. 
  58.  *        
  59.  *        Generally, it is an Unknown object, a Group of Unknown objects, or a 
  60.  *        group of other "objects" which have been found in the metafile and
  61.  *        have no attachment method to their parent. Be prepared to handle
  62.  *        any or all of these cases if you actually access the set on a shape.
  63. }
  64. {
  65. *****************************************************************************
  66.  **                                                                             **
  67.  **                                Set Routines                                 **
  68.  **                                                                             **
  69.  ****************************************************************************
  70. }
  71. FUNCTION Q3Set_New: TQ3SetObject; C;
  72. FUNCTION Q3Set_GetType(theSet: TQ3SetObject): TQ3ObjectType; C;
  73. FUNCTION Q3Set_Add(theSet: TQ3SetObject; theType: TQ3ElementType; data: UNIV Ptr): TQ3Status; C;
  74. FUNCTION Q3Set_Get(theSet: TQ3SetObject; theType: TQ3ElementType; data: UNIV Ptr): TQ3Status; C;
  75. FUNCTION Q3Set_Contains(theSet: TQ3SetObject; theType: TQ3ElementType): TQ3Boolean; C;
  76. FUNCTION Q3Set_Clear(theSet: TQ3SetObject; theType: TQ3ElementType): TQ3Status; C;
  77. FUNCTION Q3Set_Empty(target: TQ3SetObject): TQ3Status; C;
  78. {
  79.  *  Iterating through all elements in a set
  80.  *
  81.  *  Pass in kQ3ElementTypeNone to get first type
  82.  *  kQ3ElementTypeNone is returned when end of list is reached
  83. }
  84. FUNCTION Q3Set_GetNextElementType(theSet: TQ3SetObject; VAR theType: TQ3ElementType): TQ3Status; C;
  85. {
  86. *****************************************************************************
  87.  **                                                                             **
  88.  **                                Attribute Types                                 **
  89.  **                                                                             **
  90.  ****************************************************************************
  91. }
  92. {
  93.  *    For the data types listed below, pass in a pointer to it in the _Add 
  94.  *    and _Get calls.
  95.  *
  96.  *    For surface shader attributes, reference counts are incremented on 
  97.  *    the _Add and _Get 
  98. }
  99.  
  100. TYPE
  101.     TQ3AttributeTypes             = LONGINT;
  102. CONST
  103.                                                                 {  Data Type                 }
  104.     kQ3AttributeTypeNone        = {TQ3AttributeTypes}0;            {  ---------                 }
  105.     kQ3AttributeTypeSurfaceUV    = {TQ3AttributeTypes}1;            {  TQ3Param2D                 }
  106.     kQ3AttributeTypeShadingUV    = {TQ3AttributeTypes}2;            {  TQ3Param2D                  }
  107.     kQ3AttributeTypeNormal        = {TQ3AttributeTypes}3;            {  TQ3Vector3D                  }
  108.     kQ3AttributeTypeAmbientCoefficient = {TQ3AttributeTypes}4;    {  float                      }
  109.     kQ3AttributeTypeDiffuseColor = {TQ3AttributeTypes}5;        {  TQ3ColorRGB                 }
  110.     kQ3AttributeTypeSpecularColor = {TQ3AttributeTypes}6;        {  TQ3ColorRGB                 }
  111.     kQ3AttributeTypeSpecularControl = {TQ3AttributeTypes}7;        {  float                     }
  112.     kQ3AttributeTypeTransparencyColor = {TQ3AttributeTypes}8;    {  TQ3ColorRGB                 }
  113.     kQ3AttributeTypeSurfaceTangent = {TQ3AttributeTypes}9;        {  TQ3Tangent2D               }
  114.     kQ3AttributeTypeHighlightState = {TQ3AttributeTypes}10;        {  TQ3Switch                  }
  115.     kQ3AttributeTypeSurfaceShader = {TQ3AttributeTypes}11;        {  TQ3SurfaceShaderObject     }
  116.     kQ3AttributeTypeNumTypes    = {TQ3AttributeTypes}12;
  117.  
  118.  
  119. TYPE
  120.     TQ3AttributeType                    = TQ3ElementType;
  121. {
  122. *****************************************************************************
  123.  **                                                                             **
  124.  **                                Attribute Drawing                             **
  125.  **                                                                             **
  126.  ****************************************************************************
  127. }
  128. FUNCTION Q3Attribute_Submit(attributeType: TQ3AttributeType; data: UNIV Ptr; view: TQ3ViewObject): TQ3Status; C;
  129. {
  130. *****************************************************************************
  131.  **                                                                             **
  132.  **                            AttributeSet Routines                             **
  133.  **                                                                             **
  134.  ****************************************************************************
  135. }
  136. FUNCTION Q3AttributeSet_New: TQ3AttributeSet; C;
  137. FUNCTION Q3AttributeSet_Add(attributeSet: TQ3AttributeSet; theType: TQ3AttributeType; data: UNIV Ptr): TQ3Status; C;
  138. FUNCTION Q3AttributeSet_Contains(attributeSet: TQ3AttributeSet; attributeType: TQ3AttributeType): TQ3Boolean; C;
  139. FUNCTION Q3AttributeSet_Get(attributeSet: TQ3AttributeSet; theType: TQ3AttributeType; data: UNIV Ptr): TQ3Status; C;
  140. FUNCTION Q3AttributeSet_Clear(attributeSet: TQ3AttributeSet; theType: TQ3AttributeType): TQ3Status; C;
  141. FUNCTION Q3AttributeSet_Empty(target: TQ3AttributeSet): TQ3Status; C;
  142. {
  143.  * Q3AttributeSet_GetNextAttributeType
  144.  *
  145.  * Pass in kQ3AttributeTypeNone to get first type
  146.  * kQ3AttributeTypeNone is returned when end of list is reached
  147. }
  148. FUNCTION Q3AttributeSet_GetNextAttributeType(source: TQ3AttributeSet; VAR theType: TQ3AttributeType): TQ3Status; C;
  149. FUNCTION Q3AttributeSet_Submit(attributeSet: TQ3AttributeSet; view: TQ3ViewObject): TQ3Status; C;
  150. {
  151.  * Inherit from parent->child into result
  152.  *    Result attributes are:
  153.  *        all child attributes + all parent attributes NOT in the child
  154. }
  155. FUNCTION Q3AttributeSet_Inherit(parent: TQ3AttributeSet; child: TQ3AttributeSet; result: TQ3AttributeSet): TQ3Status; C;
  156. {
  157. *****************************************************************************
  158.  **                                                                             **
  159.  **                            Custom Element Registration                         **
  160.  **                                                                             **
  161.  ****************************************************************************
  162. }
  163. {
  164.  * Element Methods - 
  165.  *
  166.  *         When you create a custom element, you control what structures are 
  167.  *        passed around the API. For example, you may allow the Q3Set_Add call 
  168.  *        take one type of argument, store your element internally in some 
  169.  *        abstract data type, and have the Q3Set_Get call take a different 
  170.  *        argument.
  171.  *
  172.  *        For example:
  173.  *            
  174.  *        There are four calls which at some point will copy an element:
  175.  *
  176.  *        Q3Set_Add (copied from Application memory to QuickDraw3D memory)
  177.  *        Q3Set_Get (copied from QuickDraw3D memory to Application memory)
  178.  *        Q3Object_Duplicate (all elements are copied internally)
  179.  *        Q3AttributeSet_Inherit (all elements are copied internally)
  180.  *
  181.  *         Either CopyAdd or CopyReplace is called during the "_Add" call.
  182.  *            - CopyAdd is destructive and should assume "toElement" is garbage
  183.  *            - CopyReplace is replacing an existing element.
  184.  *
  185.  *         CopyGet is called during the "_Get" call.
  186.  *
  187.  *         CopyDuplicate is called to duplicate an element's internal structure.
  188.  *
  189.  * Attributes Methods - 
  190.  *
  191.  *        For copying data while Inheriting. Element methods are used
  192.  *        at all other times.
  193.  *    
  194.  *         CopyInherit is called to duplicate an element's internal structure 
  195.  *            during inheritance. You should make this as fast as possible.
  196.  *            (for example, if your custom element contains objects, you
  197.  *             should do a Q3Shared_GetReference instead of a Q3Object_Duplicate)
  198.  *            
  199.  *        The ElementDelete method will be called for all of your elements copied 
  200.  *        around via CopyAdd, CopyReplace, CopyDuplicate, and CopyInherit.
  201.  *        If CopyGet allocates any memory in it's destination, it is up to the app 
  202.  *        to delete it on its side.
  203. }
  204.  
  205. TYPE
  206.     TQ3ElementCopyAddMethod = ProcPtr;  { FUNCTION TQ3ElementCopyAddMethod(fromAPIElement: UNIV Ptr; toInternalElement: UNIV Ptr): TQ3Status; C; }
  207.  
  208.     TQ3ElementCopyReplaceMethod = ProcPtr;  { FUNCTION TQ3ElementCopyReplaceMethod(fromAPIElement: UNIV Ptr; ontoInternalElement: UNIV Ptr): TQ3Status; C; }
  209.  
  210.     TQ3ElementCopyGetMethod = ProcPtr;  { FUNCTION TQ3ElementCopyGetMethod(fromInternalElement: UNIV Ptr; toAPIElement: UNIV Ptr): TQ3Status; C; }
  211.  
  212.     TQ3ElementCopyDuplicateMethod = ProcPtr;  { FUNCTION TQ3ElementCopyDuplicateMethod(fromInternalElement: UNIV Ptr; toInternalElement: UNIV Ptr): TQ3Status; C; }
  213.  
  214.     TQ3ElementDeleteMethod = ProcPtr;  { FUNCTION TQ3ElementDeleteMethod(internalElement: UNIV Ptr): TQ3Status; C; }
  215.  
  216. FUNCTION Q3ElementClass_Register(elementType: TQ3ElementType; name: ConstCStringPtr; sizeOfElement: LONGINT; metaHandler: TQ3MetaHandler): TQ3ObjectClass; C;
  217. FUNCTION Q3ElementType_GetElementSize(elementType: TQ3ElementType; VAR sizeOfElement: LONGINT): TQ3Status; C;
  218. {
  219. *****************************************************************************
  220.  **                                                                             **
  221.  **                        Custom Attribute Registration                         **
  222.  **                                                                             **
  223.  ****************************************************************************
  224. }
  225.  
  226. TYPE
  227.     TQ3AttributeInheritMethod            = TQ3Boolean;
  228. {  return kQ3True or kQ3False in your metahandler  }
  229.     TQ3AttributeCopyInheritMethod = ProcPtr;  { FUNCTION TQ3AttributeCopyInheritMethod(fromInternalAttribute: UNIV Ptr; toInternalAttribute: UNIV Ptr): TQ3Status; C; }
  230.  
  231. FUNCTION Q3AttributeClass_Register(attributeType: TQ3AttributeType; creatorName: ConstCStringPtr; sizeOfElement: LONGINT; metaHandler: TQ3MetaHandler): TQ3ObjectClass; C;
  232. {$ALIGN RESET}
  233. {$POP}
  234.  
  235. {$SETC UsingIncludes := QD3DSetIncludes}
  236.  
  237. {$ENDC} {__QD3DSET__}
  238.  
  239. {$IFC NOT UsingIncludes}
  240.  END.
  241. {$ENDC}
  242.